package com.iplatform.file.function.resourcedata.feign;


import com.iplatform.module.privilege.PriMenuBean;
import com.iplatform.module.sys.dto.SysDataTypeDto;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@FeignClient(value = "cppcc-user")
public interface UserClient {
	
	@ApiOperation(value = "根据数据字典类型code获取菜单id")
	@GetMapping(value = "/api/v1/menu/findMenuIdBySysDataCodeType")
	 ResponseEntity<PriMenuBean> findMenuIdBySysDataCodeType(@RequestParam(value = "typeCode") String typeCode);
	
	
	
	@ApiOperation(value = "新增菜单")
	@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "成功"),
			@ApiResponse(code = HttpServletResponse.SC_CONFLICT, message = "没有做到API使用规范") })
	@PostMapping(value = "/api/v1/menu/")
	 ResponseEntity<PriMenuBean> add(@RequestBody PriMenuBean priMenuBean);

	@ApiOperation(value = "根据数据类型查询字典列表(右)")
	@GetMapping(value = "/api/v1/sysdata/typeCodeAndNameListV2")
	public List<SysDataTypeDto> typeCodeAndNameList(@RequestParam(value = "typeCode") String typeCode,
										  @RequestParam(value = "code")String code,
										  @RequestParam(value = "codeName")String codeName,
										  @RequestParam(value = "dataType")String dataType);

}
